package service;

import com.root.health.bean.MedicationInfo;
import com.root.health.mapper.MedicationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

@Service
public class MedicationService {
    @Autowired
    MedicationMapper medicationMapper;
    public void medicationInfo(String medName, Timestamp medicationTime, String medicationDose, String medicationAlert, long medicationDone,long userid){
        medicationMapper.medication(medName,medicationTime,medicationDose,medicationAlert,medicationDone,userid);
    }//服药信息添加
    public List<MedicationInfo> selectmedication(long userid){
        return medicationMapper.selectmedication(userid);
    }//服药信息查询
    public MedicationInfo selectmedicationByMedicationId(long medicationid){
        return medicationMapper.selectmedicationByMedicationId(medicationid);
    }
    //服药信息查询
    public void medicationDel(long medicationid){
        medicationMapper.medicationDel(medicationid);
    }
    //服药信息删除
    public void medicationUpd(Timestamp medicationTime, String medicationDose, String medicationAlert, long medicationDone, long medicationId){
        medicationMapper.medicationUpd(medicationTime,medicationDose,medicationAlert,medicationDone,medicationId);
    }//服药信息修改
    public void medicationDone(long medicationId){
        medicationMapper.medicationDone(medicationId);
    }
    //服药信息完成
    public Integer medicationCheck(String medName, Timestamp medicationTime, String medicationDose, String medicationAlert, long medicationDone,long userid){
        return medicationMapper.medicationCheck(medName,medicationTime,medicationDose,medicationAlert,medicationDone,userid);
    }//服药信息校验
}
